#>author: fuml
#>date:2019-9-8
#>desc:os 模块

import os
print(help(os))

# getcwd 
print(os.getcwd())

m_path=os.getcwd()
# chdir
os.chdir('D:\\daka')
print(os.getcwd())

#curdir
print(os.curdir)

#pardir
print(os.pardir)

# makedirs
#> raw 原生字符串
os.makedirs(r'abc\fuml',exist_ok=True)

# listdir  #>list dir and file
print(os.listdir('.'))

# removedirs
os.removedirs('abc\\fuml')


# mkdir  #>cannot recursive

# rmdir

# remove  #> only delete file  cannot delete dir
# os.remove('AHF_FlowGas0.txt')



# rename   
#os.rename('AHF_FlowGas0.txt','AHF_FlowGas_copy.txt')


# stat

info=os.stat('AHF_FlowGas0.txt')
print(info.st_size)

# sep  #> unix and windows is different ,so sep is follow system
print(os.sep)
m_sep=os.sep
os.makedirs('fff%seee' %m_sep,exist_ok=True)

# linesep  回车是\n 还是 \r\n

# pathsep  path环境变量分隔符 windows ;  unix :

# system  直接调用cmd 命令
print(os.system('dir'))

# environ
os.environ

# path

print(m_path)

m_srcPath=os.path.abspath(m_path)
print(m_srcPath)

## path.split
print(os.path.split(m_srcPath))

## path.dirname
print(os.path.dirname(m_srcPath))

## path.basename
print(os.path.basename(m_srcPath))

## path.exists(path)
## path.isabs(path)  #> 是否是绝对路径
## path.isfile
## path.isdir
## path.join
## path.getatime   #> path 所指向的文件或者目录的最后存取(访问/attach)时间
## path.getmtime   #> path 所指向的文件或者目录的最后修改(modify)时间

